1302. 层数最深叶子节点的和
https://leetcode.cn/problems/deepest-leaves-sum/description/
给你一棵二叉树的根节点 root ，请你返回 层数最深的叶子节点的和 。


int TreeDeepth(struct TreeNode*root)
{
    if(root==NULL)
    {
        return 0;
    }
    int LeftDeepth=TreeDeepth(root->left);
    int RightDeepth=TreeDeepth(root->right);
    return LeftDeepth>RightDeepth?LeftDeepth+1:RightDeepth+1;
}

int _deepestLeavesSum(struct TreeNode*root,int deep,int*sum)
{
    if(root==NULL)
    {
        return 0;
    }
    if(deep==1)
    {
        *sum+=root->val;
    }
    _deepestLeavesSum(root->left,deep-1,sum);
    _deepestLeavesSum(root->right,deep-1,sum);

    return ;
}
int deepestLeavesSum(struct TreeNode* root){
    int deepth=TreeDeepth(root);
    int sum=0;
    _deepestLeavesSum(root,deepth,&sum);
    return sum;
}